//
//  RightTableViewCell.m
//  自定义collectionView
//
//  Created by apple on 15-1-4.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "RightTableViewCell.h"

@implementation RightTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier andTitleName:(NSString * )titleStr andColorFlag:(int)flag
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        UILabel * lab = [[UILabel alloc]initWithFrame:CGRectMake(25 , 5, 250, 30)];
        [self addSubview:lab];
        lab.text = titleStr;
        lab.font = [UIFont fontWithName:nil size:13];
        lab.textAlignment = NSTextAlignmentLeft;
        
        UIButton * btn = [[UIButton alloc]initWithFrame:CGRectMake(320-40-85,5 , 30, 30)];
        [self addSubview:btn];
        [btn addTarget:self action:@selector(doBtn:) forControlEvents:UIControlEventTouchUpInside];
        NSLog(@"%d",flag%2);
        if (flag ==1) {
            [btn setImage:[UIImage imageNamed:@"icon_二级菜单未展开"] forState:UIControlStateNormal];
        }else {
            [btn setImage:[UIImage imageNamed:@"icon_二级菜单展开"] forState:UIControlStateNormal];
        }
    }
    return self;
}
-(void)doBtn:(UIButton *)sender
{
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
